Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support sbom generation when releasing #22

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

innobead
Copy link
Member

@innobead innobead commented Jul 29, 2024

Example output of check-images-ready.sh.

ref: longhorn/longhorn#8821

Output of example `./check-images-ready.sh longhornio/longhorn-manager:v1.6.2 longhornio/longhorn-engine:v1.6.2`
./check-images-ready.sh longhornio/longhorn-manager:v1.6.2 longhornio/longhorn-engine:v1.6.2
+ images=("$@")
+ found_images=()
+ check_images_ready
+ for i in {1..20}
+ for img in "${images[@]}"
+ echo 'Inspecting (1 time): longhornio/longhorn-manager:v1.6.2'
Inspecting (1 time): longhornio/longhorn-manager:v1.6.2
+ skopeo inspect docker://longhornio/longhorn-manager:v1.6.2
+ found_images+=("$img")
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ echo 'Inspecting (1 time): longhornio/longhorn-engine:v1.6.2'
Inspecting (1 time): longhornio/longhorn-engine:v1.6.2
+ skopeo inspect docker://longhornio/longhorn-engine:v1.6.2
+ found_images+=("$img")
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ for i in {1..20}
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-manager:v1.6.2 ']'
+ continue 2
+ for img in "${images[@]}"
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-manager:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ for fimg in "${found_images[@]}"
+ '[' longhornio/longhorn-engine:v1.6.2 == longhornio/longhorn-engine:v1.6.2 ']'
+ continue 2
+ '[' 2 -ne 2 ']'
+ generate_sbom_for_images
+ for img in "${images[@]}"
+ echo 'Generating longhornio/longhorn-manager:v1.6.2 SBOM and checksum'
Generating longhornio/longhorn-manager:v1.6.2 SBOM and checksum
+ sbom_name=longhorn-manager:v1.6.2.sbom
+ syft longhornio/longhorn-manager:v1.6.2 -o spdx-json
 ✔ Loaded image                                                                                                                                                                                 longhornio/longhorn-manager:v1.6.2
 ✔ Parsed image                                                                                                                                            sha256:6b0b2d18564be0260c96c39f4e88f0030f4e8ae75f81c9255654be0488657592
 ✔ Cataloged contents                                                                                                                                             65e40ab02dc5efb3bbccfaac87313948954e616099d07ca29ba5d990e0e42d6b
   ├── ✔ Packages                        [364 packages]  
   ├── ✔ File digests                    [6,792 files]  
   ├── ✔ File metadata                   [6,792 locations]  
   └── ✔ Executables                     [1,099 executables]  
A newer version of syft is available for download: 1.9.0 (installed version is 1.7.0)
+ sha256sum longhorn-manager:v1.6.2.sbom
+ for img in "${images[@]}"
+ echo 'Generating longhornio/longhorn-engine:v1.6.2 SBOM and checksum'
Generating longhornio/longhorn-engine:v1.6.2 SBOM and checksum
+ sbom_name=longhorn-engine:v1.6.2.sbom
+ syft longhornio/longhorn-engine:v1.6.2 -o spdx-json
 ✔ Loaded image                                                                                                                                                                                  longhornio/longhorn-engine:v1.6.2
 ✔ Parsed image                                                                                                                                            sha256:7fb50a1bbe317e1a03f4208d1e16853d4db9246a3afae79286fe931349e982c4
 ✔ Cataloged contents                                                                                                                                             1758bdbf6bffdd3fe4a2b9f0b6bb64a72f2ed002befae3ded88c27d2362337da
   ├── ✔ Packages                        [343 packages]  
   ├── ✔ File digests                    [7,105 files]  
   ├── ✔ File metadata                   [7,105 locations]  
   └── ✔ Executables                     [1,167 executables]  
A newer version of syft is available for download: 1.9.0 (installed version is 1.7.0)
+ sha256sum longhorn-engine:v1.6.2.sbom
+ tar --null -zcvf longhorn-images-sbom.tar.gz --files-from -
+ find . '(' -name '*.sbom' -o -name '*.sbom.sha256sum' ')' -print0
./longhorn-manager:v1.6.2.sbom
./longhorn-manager:v1.6.2.sbom.sha256sum
./longhorn-engine:v1.6.2.sbom
./longhorn-engine:v1.6.2.sbom.sha256sum
+ tar -tvf longhorn-images-sbom.tar.gz
-rw-r--r-- davidko/davidko 5759499 2024-07-29 18:13 ./longhorn-manager:v1.6.2.sbom
-rw-r--r-- davidko/davidko      95 2024-07-29 18:13 ./longhorn-manager:v1.6.2.sbom.sha256sum
-rw-r--r-- davidko/davidko 5956256 2024-07-29 18:13 ./longhorn-engine:v1.6.2.sbom
-rw-r--r-- davidko/davidko      94 2024-07-29 18:13 ./longhorn-engine:v1.6.2.sbom.sha256sum

@innobead innobead merged commit 874737e into longhorn:main Aug 1, 2024
2 checks passed
@innobead innobead deleted the feat-sbom branch August 1, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant